home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / Thing / CThingContainer.as < prev    next >
Encoding:
Text File  |  2011-08-19  |  5.6 KB  |  246 lines

  1.  
  2. {
  3.    if(true)
  4.    {
  5.       CThingContainer = ┬º┬ºnewclass(CThingContainer,CThingBase);
  6.    }
  7. }
  8.  
  9. package Local.Game.Thing
  10. {
  11.    import Local.Game.World.Map.*;
  12.    import flash.events.*;
  13.    import flash.geom.*;
  14.    
  15.    public class CThingContainer extends CThingBase
  16.    {
  17.       
  18.       public static const ADDED:String = "ADDED";
  19.       
  20.       public static const GROUPID_FRIEND:int = 1;
  21.       
  22.       public static const GROUPID_ENEMY:int = 2;
  23.       
  24.       public static const REMOVED:String = "REMOVED";
  25.        
  26.       
  27.       private var _GroupID:int;
  28.       
  29.       private var mThings:Array;
  30.       
  31.       public var mParent:*;
  32.       
  33.       public function CThingContainer()
  34.       {
  35.          super();
  36.       }
  37.       
  38.       public function get mChildren() : Array
  39.       {
  40.          if(true)
  41.          {
  42.             return !!mThings ? mThings.slice() : [];
  43.          }
  44.          ┬º┬ºgoto(addr13);
  45.       }
  46.       
  47.       internal function GetKilledBy() : CThingContainer
  48.       {
  49.          if(true)
  50.          {
  51.             ┬º┬ºpush(mParent);
  52.             if(mParent)
  53.             {
  54.                ┬º┬ºpop();
  55.                if(true)
  56.                {
  57.                   ┬º┬ºpush(mBaseType == "shot");
  58.                   if(!(mBaseType == "shot"))
  59.                   {
  60.                      ┬º┬ºpop();
  61.                      if(true)
  62.                      {
  63.                         return (mBaseType == "weapon" || mBaseType == "effect") && Boolean(mParent.mBaseType) ? mParent.GetKilledBy() : this;
  64.                         addr37:
  65.                      }
  66.                      ┬º┬ºgoto(addr40);
  67.                   }
  68.                   ┬º┬ºgoto(addr37);
  69.                }
  70.                ┬º┬ºgoto(addr48);
  71.             }
  72.             ┬º┬ºgoto(addr37);
  73.          }
  74.          ┬º┬ºgoto(addr52);
  75.       }
  76.       
  77.       private function Process_Dispose() : void
  78.       {
  79.          if(!Process_Children())
  80.          {
  81.             Dispose();
  82.          }
  83.       }
  84.       
  85.       public function get mNumChildren() : int
  86.       {
  87.          if(true)
  88.          {
  89.             if(mThings)
  90.             {
  91.                addr13:
  92.                ┬º┬ºpush(int(mThings.length));
  93.                if(true)
  94.                {
  95.                }
  96.             }
  97.             else
  98.             {
  99.                ┬º┬ºpush(0);
  100.             }
  101.             return ┬º┬ºpop();
  102.          }
  103.          ┬º┬ºgoto(addr13);
  104.       }
  105.       
  106.       public function Process_Children() : Boolean
  107.       {
  108.          var _loc1_:* = undefined;
  109.          for each(_loc1_ in mChildren)
  110.          {
  111.             if(_loc1_.Process)
  112.             {
  113.                _loc1_.Process();
  114.             }
  115.          }
  116.          return mNumChildren > 0;
  117.       }
  118.       
  119.       public function get mGroupID() : int
  120.       {
  121.          ┬º┬ºpush(┬º┬ºfindproperty(_GroupID));
  122.          if(true)
  123.          {
  124.             ┬º┬ºpush(!_GroupID);
  125.             if(true)
  126.             {
  127.                ┬º┬ºpush(┬º┬ºpop() && mParent);
  128.             }
  129.             return ┬º┬ºpop()._GroupID = !!┬º┬ºpop() ? int(mParent.mGroupID) : _GroupID;
  130.          }
  131.          ┬º┬ºgoto(addr29);
  132.       }
  133.       
  134.       public function RemoveThing(param1:*) : *
  135.       {
  136.          if(true)
  137.          {
  138.             param1.mParent = null;
  139.             if(true)
  140.             {
  141.                mThings.splice(mThings.indexOf(param1),1);
  142.                if(true)
  143.                {
  144.                   if(mThings.length)
  145.                   {
  146.                   }
  147.                   param1.dispatchEvent(new Event(REMOVED));
  148.                   addr49:
  149.                   return param1;
  150.                   addr37:
  151.                }
  152.                mThings = null;
  153.             }
  154.             ┬º┬ºgoto(addr37);
  155.          }
  156.          ┬º┬ºgoto(addr49);
  157.       }
  158.       
  159.       public function Draw_Children() : Boolean
  160.       {
  161.          var _loc1_:* = undefined;
  162.          for each(_loc1_ in mChildren)
  163.          {
  164.             _loc1_.Draw();
  165.          }
  166.          return true;
  167.       }
  168.       
  169.       override public function Dispose() : void
  170.       {
  171.          var _loc1_:* = undefined;
  172.          if(true)
  173.          {
  174.             if(mDisposed)
  175.             {
  176.                if(true)
  177.                {
  178.                   return;
  179.                }
  180.             }
  181.             else if(mParent)
  182.             {
  183.                mParent.RemoveThing(this);
  184.             }
  185.             if(mThings)
  186.             {
  187.                addr35:
  188.                for each(_loc1_ in mThings.slice())
  189.                {
  190.                   if(true)
  191.                   {
  192.                      _loc1_.Dispose();
  193.                   }
  194.                }
  195.             }
  196.             super.Dispose();
  197.             return;
  198.          }
  199.          ┬º┬ºgoto(addr35);
  200.       }
  201.       
  202.       public function set mGroupID(param1:int) : void
  203.       {
  204.          _GroupID = param1;
  205.       }
  206.       
  207.       public function mChildrenCount() : int
  208.       {
  209.          return mThings.length;
  210.       }
  211.       
  212.       override public function toString() : String
  213.       {
  214.          return mType + "." + String(_GroupID) + "." + String(nID);
  215.       }
  216.       
  217.       public function AddThing(param1:*) : *
  218.       {
  219.          if(param1.mParent)
  220.          {
  221.             param1.mParent.RemoveThing(param1);
  222.          }
  223.          param1.mParent = this;
  224.          if(mThings)
  225.          {
  226.             mThings.push(param1);
  227.          }
  228.          else
  229.          {
  230.             mThings = [param1];
  231.          }
  232.          param1.dispatchEvent(new Event(ADDED));
  233.          return param1;
  234.       }
  235.       
  236.       public function AddKill() : *
  237.       {
  238.          if(true)
  239.          {
  240.             return !!mParent ? mParent.AddKill() : this;
  241.          }
  242.          ┬º┬ºgoto(addr13);
  243.       }
  244.    }
  245. }
  246.